<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数组的内置方法</title>
</head>
<body>
    
    <script>
        
        {
            // 数组的内置方法

            let ary = [1,2,3,4];

            // 增删
            ary.push(5);
            ary.unshift(0);
            ary.shift();
            ary.pop();
            
            // 插入
            ary.splice(1,0,0);
            console.log(ary);

            ary.splice(2,3);
            console.log(ary);

            // 查询

            console.log(ary.indexOf(4));

            // 数组的截取

            console.log(ary.slice(1,4));

            // 遍历

            ary.forEach(ele=>{
                console.log(ele);
            });

            let arr = ary.filter(ele=>{
                return ele>0;
            })

            console.log(arr);

        }

        {

            let ary = [4,5,6,7,8,9];

            ary.find(ele=>{

            })

        }

        {
            let ary = [4,5,6,7,8,9];
            let args = {'0':'a','1':'b','2':'c',length:3};
            let a = Array.from(args);
            console.log(a);
            
            let b = "10,11,12,14,15";
            console.log(Array.of(1,2,3,4,5,6));
            

        }
    

        {
            
        }
    </script>
</body>
</html>